<!DOCTYPE html>
<html lang="zh">

	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<meta http-equiv="X-UA-Compatible" content="ie=edge" />
		<script src="../../js/lib/jquery-v3.0.0/jquery.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/lib/jquery-sammy-v0.7.6/sammy.js" type="text/javascript" charset="utf-8"></script>
		<title>jquery.sammy</title>
	</head>

	<body>
		<p>jquery.sammy 官方demo</p>
		<script type="text/javascript">
			// initialize the application
			var app = Sammy('#main', function() {
				// include a plugin
				this.use('Mustache');

				// define a 'route'
				this.get('#/', function() {
					// load some data
					this.load('posts.json')
						// render a template
						.renderEach('post.mustache')
						// swap the DOM with the new content
						.swap();
				});
			});
			// start the application
			app.run('#/');
		</script>
	</body>

</html>